<%-- 
    Document   : departmentsList
    Created on : Oct 17, 2012, 9:15:38 AM
    Author     : DinhThang
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript" src="../scripts/nicEdit.js"></script>
<script type="text/javascript">
    bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>JSP Page</title>
            <link rel="stylesheet" type="text/css" href="../styles/style.css" />
        </head>
        <body            
            <jsp:include page="../includes/incHeader.jsp" flush="false" />
            <h3>Update Article</h3>
            <h:form>
                <h:message style="color: red" for="txtTitle" />
                <h:inputHidden value="#{articlesBean.article.articleID}"/>
                <h:inputHidden value="#{articlesBean.article.userID}"/>
                <h:inputHidden value="#{articlesBean.article.createTime}">
                    <f:convertDateTime type="date" dateStyle="full" />
                </h:inputHidden>    
                <h:panelGrid columns="2" style="margin:0 auto">
                    <h:outputText value="Title:"/>
                    <h:inputText id="txtTitle" value="#{articlesBean.article.title}" required="true" />

                    <h:outputText value="Describe"/>
                    <h:inputTextarea rows="4" cols="80" value="#{articlesBean.article.describe}"/>

                    <h:outputText value="Content:"/>
                    <h:inputTextarea rows="10" cols="80" value="#{articlesBean.article.mainContent}"/>

                    <h:outputText value="IsEnable: "/>
                    <h:selectOneRadio value="#{articlesBean.article.isEnable}">
                        <f:selectItem itemLabel="True" itemValue="true"/>
                        <f:selectItem itemLabel="False" itemValue="false"/>
                    </h:selectOneRadio>

                    <h:commandButton action="articlesEditBack" value="Back"/>
                    <h:commandButton action="#{articlesBean.update}" value="Save"/>
                </h:panelGrid>
            </h:form>
            <jsp:include page="../includes/incFooter.jsp" flush="false" />
        </body>
    </html>
</f:view>